import { defineStore } from 'pinia';
import * as actypes from '../types';

export const useAppStore = defineStore('app', {
  state: () => {
    return {
      tabBar: true,
      isLogin: false,
      userinfo: null
    };
  },
  actions: {
    [actypes.SET_TAB_BAR](payload) {
      this.tabBar = payload;
    },
    [actypes.SET_LOGIN](payload) {
      this.isLogin = payload;
    },
    [actypes.SET_USERINFO](payload) {
      this.userinfo = payload;
    }
  }
});
